<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Maquetación</title>
<style type="text/css">
<!--
body,td,th {
	color: #666666;
	font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
	font-size:12px;
	
}
a{border:1px solid #cccccc;text-align:center;color: #666666;}
body {
	background-color: #ffffff;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	padding:0px;
	overflow-x:hidden;
}

#imagen{
	border:none;
	padding:0px;
	margin:0px;
}


.flecha{
	font-size:40px;
	color:#CCCCCC;
	font-weight:bolder;
}
.flecha a{
color:#CCCCCC;
border:0;
text-decoration:none;
}


.flecha:hover,.flecha:hover a{
	color:#FFFFFF;
	background-color:#CCCCCC;
}

.menu{
	color:#cccccc;
	font-size:12px;
	font-weight:bold;
	font-family:Verdana, Arial, Helvetica, sans-serif;
}

.menu a{
	color:#cccccc;
	text-decoration:none;
	border:0;
}
.menu a:hover{
	text-decoration:underline;
	color:#999999;
}
-->
</style></head>

<body>
<?php

$raiz="";
while (!file_exists("$raiz"."../maquetas/")) $raiz.="../";
$img=@$_GET["img"];
$imagenes=scandir(".");
if($img!=""){
	for($i=0;$i<count($imagenes);$i++){
		if($img==$imagenes[$i]){
			$anterior=@$imagenes[$i-1];
			$anterior_idx=$i-1;
			$siguiente=@$imagenes[$i+1];
			$siguiente_idx=$i+1;
		}
	}

?>


<div align="center" style="position:relative; height:60px;">
	<table width="1280" height="60" cellpadding="0" cellspacing="0" border="0" >
    	<tr>
        	<td width="40" valign="middle" align="center" class="flecha"><?php if($anterior!=""){ ?><a href="index.php?img=<?=$anterior."&anchor=".$anterior_idx; ?>" >&lt;</a><?php } ?></td>
            <td width="1200"  valign="middle" align="center" class="menu"><a href="index.php#img<?php echo $_GET["anchor"]; ?>">Ver Maquetas</a></td>
            <td width="40"  valign="middle" align="center" class="flecha"><?php if($siguiente!=""){ ?><a href="index.php?img=<?=$siguiente."&anchor=".$siguiente_idx; ?>" >&gt;</a><?php } ?></td>
        </tr>
    </table>
</div>
<div align="center" style="position:relative;" ><a id="imagen" style="text-decoration:none;" href="index.php#img<?php echo $_GET["anchor"]; ?>"><img border="0"src="<?=$img?>" /></a></div>
<?php 
}else{?>

	<table width="100%" height="60" cellpadding="0" cellspacing="0" border="0" >
    	<tr>
        	<td width="40" valign="middle" align="center"><?php
            echo "<a href=\"$raiz\" style=\"margin:0.5em;padding:5px;text-decoration:none;\" >
            MAQUETAS/</a>";
	//folders
	for($i=0;$i<count($imagenes);$i++){
		
		if(is_dir($imagenes[$i])===TRUE && $imagenes[$i]!="." && $imagenes[$i]."/"!=$raiz) {?>
            <a href="<?=$imagenes[$i]; ?>" style="margin:0.5em;padding:5px;text-decoration:none;" >
            <?=$imagenes[$i]?>/</a>
		<?php
		}
	}
?></td>
        </tr>
    </table>



<?php 



	for($i=0;$i<count($imagenes);$i++){
		$tit_img=ucwords(str_replace("0","",str_replace(".jpg","",str_replace("_"," ",$imagenes[$i]))));
		if(strpos($imagenes[$i],".jpg")!==FALSE) {?>
		<a name="img<?php echo $i; ?>" style="width:390px;height:260px;float:left;margin:10px;text-decoration:none;overflow:hidden;" href="index.php?img=<?=$imagenes[$i]."&anchor=".$i; ?>"  >
		<!--<img border="0"src="<?=$imagenes[$i]?>" style="width:500px;"/>-->
		<?=$tit_img?><br /><img border="0" src="resizeimg.php?url=<?=$imagenes[$i]?>&tam=390"  /> <br />
		<?=strtoupper($imagenes[$i])?></a>
		<?php
		}
	}
}


?>
</body>
</html>

